<md-dialog aria-label="修改用户" style="width:600px;">
  <form name="modifyForm" novalidate>
    <md-toolbar>
      <div class="md-toolbar-tools">
        <h2>修改用户</h2>
        <span flex></span>
        <md-button aria-label="关闭" class="md-icon-button" ng-click="cancel()">
          <i class="glyphicon glyphicon-remove"></i>
        </md-button>
      </div>
    </md-toolbar>
    <md-dialog-content>
      <div>
        <div layout layout-sm="column">
          <md-input-container flex>
            <label>用户名</label>
            <input ng-model="notSend.uName" ng-maxlength="10" ng-pattern="/^[A-Za-z0-9]+$/" name="userU" required
                   disabled self-form="checkIdCard">
            <!-- <div ng-messages="modifyForm.userU.$error">
              <div ng-message="required">*必填</div>
              <div ng-message="maxlength">用户名不超过10位</div>
              <div ng-message="pattern">请输入字母和数字</div>
            </div> -->
          </md-input-container>
          <md-input-container flex>
            <label>密码</label>
            <input name="userP" ng-model="notSend.PPWD" disabled>
          </md-input-container>
        </div>
        <div layout layout-sm="column">
          <md-input-container flex>
            <label>姓名</label>
            <input ng-model="userInfo.realName" name="userN" ng-maxlength='10'
                   ng-pattern='/^([A-Za-z]|[\u4E00-\u9FA5])+$/' required>

            <div ng-messages="modifyForm.userN.$error">
              <div ng-message="required">*必填</div>
              <div ng-message="maxlength">姓名不超过10位</div>
              <div ng-message="pattern">请输入英文或者中文姓名</div>
            </div>
          </md-input-container>
          <div flex class="gender">
            <md-radio-group ng-model="userInfo.sex">
              <md-radio-button value="1">女</md-radio-button>
              <md-radio-button value="0" class="md-primary">男</md-radio-button>
            </md-radio-group>
          </div>
        </div>
        <div layout layout-sm="column">
          <md-input-container flex>
            <label>邮箱</label>
            <input ng-model="userInfo.email" type="email" ng-required="true" name="userE">

            <div ng-messages="modifyForm.userE.$error">
              <div ng-message="required">*必填</div>
              <div ng-message="email">请输入正确的邮箱</div>
            </div>
          </md-input-container>
          <md-input-container flex>
            <label>身份证</label>
            <input ng-model="userInfo.idCard"  ng-maxlength='18' ng-pattern='/(^\d{15}$)|(^\d{17}([0-9]|X)$)/' name="userI" required self-form="checkIdCard">
            <div ng-messages="modifyForm.userI.$error">
              <div ng-message="required">*必填</div>
              <div ng-message="check-repeat">*身份证已存在</div>
              <div ng-message="maxlength">不超过18位</div>
              <div ng-message="pattern">15或者18位数字</div>
            </div>
          </md-input-container>
        </div>
        <div layout layout-sm="column">
          <md-input-container flex>
            <label>手机</label>
            <input ng-model="userInfo.phone"  ng-pattern='/^[1-9]\d{10}$/' name="userPhone" required>
            <div ng-messages="modifyForm.userPhone.$error">
              <div ng-message="required">*必填</div>
              <div ng-message="pattern">请输入11位正确数字</div>
            </div>
          </md-input-container>
          <md-select ng-model="userInfo.role" md-on-open="loadRoles()" name="role" style="min-width: 275px;">
            <md-select-label>{{ userInfo.role ? userInfo.role.roleName : userInfo.roleName }}</md-select-label>
            <md-option ng-value="roleInfo" ng-repeat="roleInfo in roleInfos">{{roleInfo.roleName}}</md-option>
          </md-select>
        </div>
        <div layout layout-sm="column">
          <md-input-container flex>
            <label>到期时间</label>
            <input type="date" ng-model="userInfo.expTime"  required name="Time" max-date="userInfo.expTime">

            <div ng-messages="modifyForm.Time.$error">
              <div ng-message="required">*请选择时间</div>
              <div ng-message="cuo-great">请选择正确时间</div>
            </div>
          </md-input-container>
        </div>
      </div>
    </md-dialog-content>

    <div class="md-actions" layout="row">
      <span flex></span>
      <md-button ng-click="cancel()" class="md-primary">
        取消
      </md-button>
      <md-button ng-click="queding(userInfo)" class="md-primary" ng-disabled="modifyForm.$invalid">
        确定
      </md-button>
    </div>
  </form>
</md-dialog>